package com.geely.design.pattern.behavioral.responsibilitychain;

import org.springframework.util.StringUtils;

public class NameApprover extends Approver {

    public NameApprover(Approver approver) {
        super(approver);
    }

    @Override
    public void deploy(Course course) {
        if (!StringUtils.isEmpty(course.getName())) {
            System.out.println("name有内容,允许通过!当前节点处理完毕,交给下一节点处理");
            if (super.nextApprover != null) {
                super.nextApprover.deploy(course); // 交给下一节点处理
            }
        } else {
            System.out.println("name无内容,不通过,流程到此结束");
        }
    }


}
